# Load data
data <- readRDS("Data/exp_1/data.rds")

##################
### RUN MODELS ###
##################

# Manipulation check
lm_robust(
    perceived_outparty_SUP_post ~ treatment,
    data = data %>% subset(inparty_in_treatment == 0)
)

# DV
exp1_model <- lm_robust(
    SUP_post ~ treatment * inparty_in_treatment,
    data = data
)

## Slopes
exp1_slopes <- avg_slopes(
    exp1_model,
    by = "inparty_in_treatment",
    variables = "treatment"
) %>%
    as.data.frame() %>%
    mutate(dv = "Support for Undemocratic Practices", Study = "Experiment 1")

###################
### SAVE SLOPES ###
###################

save(
    exp1_slopes,
    file = "Data/exp_1/slopes.Rdata"
)
